<?php
/**
 * 会员中心——账户概览
 *
 *
 *
 * * @网店运维 (c) 2015-2018 ShopWWI Inc. (http://www.shopwwi.com)
 * @license    http://www.shopwwi.c om
 * @link       交流群号：111731672
 * @since      网店运维提供技术支持 授权请购买shopnc授权
 */



defined('ByShopWWI') or exit('Access Invalid!');

class memberControl extends BaseMemberControl{

    /**
     * 我的商城
     */
    public function homeOp() {
        $model_consume = Model('consume');
        $consume_list = $model_consume->getConsumeList(array('member_id' => $_SESSION['member_id']), '*', 0, 10);
        Tpl::output('consume_list', $consume_list);
        Tpl::showpage('member_home');
    }
    /**
     * 报单中心注册会员
     */
    public function baodanOp() {
        
        if($this->member_info['member_type']!=5)
        {
           showMessage('无操作权限',urlMember('member', 'home'),'html','error');
           exit;
        }
       
        Language::read('home_login_register');
        Tpl::showpage('baodan');
    }
    
    /**
     * 店长申请成为报单中心
     */
    public function applyformOp() {
        
        if($this->member_info['member_type']!=4)
        {
            showMessage('无操作权限',urlMember('member', 'home'),'html','error');
            exit;
        }
        $lang   = Language::getLangContent();
        $result = chksubmit(true,false,'alert');
        $data=array();
        $model_apply= Model('apply_form');
        if($result)
        {
           $data['member_id']=$this->member_info['member_id'];
           $data['member_name']=$this->member_info['member_name'];
           $data['member_truename']=$this->member_info['member_truename'];
           $data['remark']=$_POST['remark'];
           $res=$model_apply->addApply($data);
           if($res)
           {
                showDialog('申请已提交', urlMember('member', 'applyform'), 'succ');
           }
           else
           {
               showDialog('提交失败:您有未审核或已通过的申请', urlMember('member', 'applyform'), 'error');
           }
        }
        
        Tpl::showpage('applyform');
    }
    
		
}
